{% load tagging_tags %}

{% if organisation_list %}
<table width="100%">
  <tr>
    <th>Organisation Name</th>
    <th>Tags</th>
  </tr>
  {% for org in organisation_list %}
  <tr>
    <td>
      <div class="name"><a href="{% url crm_organisation_detail object_id=org.id %}">{{ org }}</a></div>
    </td>
    <td>
      {% tags_for_object org as tags %} 
      {% for tag in tags %}
        <a href="{% url crm_tagged_organisation tag_name=tag.name %}">{{ tag.name }}</a>
      {% endfor %}
    </td>
  </tr>
  {% endfor %}
</table>
{% else %}
  <p>No organisations</p>
{% endif %}
